from socket import *

def host(ip, port):
    sock = socket()
    sock.bind((str(ip), port))
    sock.listen(1)
    sock.settimeout(10)
    new_sock = sock.accept()[0]
    return new_sock

def connect(ip, port):
    sock = socket()
    sock.connect((str(ip), port))
    return sock
